package com.vf.admin.client.filter;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.DecimalFormat;

@Slf4j
public class LogCostFilter implements Filter {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    private HttpServletRequest request;

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        this.request = (HttpServletRequest) servletRequest;
        String path = request.getRequestURI();
        long start = System.currentTimeMillis();
        filterChain.doFilter(servletRequest, servletResponse);
        long end = System.currentTimeMillis();
        DecimalFormat df = new DecimalFormat("0.000");
    }
}
